Conventionally, an encoder is disclosed in which a scanning constitution unit includes a main unit that supports a scanning plate and can be mounted by the main unit to an object to be measured, and heat of electric constituent elements of the scanning constitution unit is transferred from an internal space to a contact surface outside of a contact element (a cover) by a heat transfer element through a heat transfer path, and in which when the scanning constitution unit is mounted on the object to be measured, the contact surface makes close contact with the object to be measured, which functions as a heat sink, thereby dissipating the heat of the electric constituent elements to the object to be measured (see, for example, Patent Literature 1).